package com.example.qihuibao.module.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import com.example.qihuibao.module.splash.SplashActivity;
import com.example.qihuibao.utils.CommonUtil;
import com.example.qihuibao.utils.LogUtil;

public class BootCompleteReceiver extends BroadcastReceiver {

    @Override
    public void onReceive(Context context, Intent arg1) {
        if (!CommonUtil.ifAppProcessExit(context, context.getPackageName())) {
            Intent intent = new Intent(context, SplashActivity.class);
            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);//必须
            context.startActivity(intent);
            LogUtil.INSTANCE.e("=========开机自启动=========="+arg1.getAction());
        }
    }
}
